x86/monitor: disallow setting mem_access_emulate_each_rep when vm_event is NULL
authorRazvan Cojocaru <rcojocaru@bitdefender.com>
Wed, 4 May 2016 07:42:06 +0000 (09:42 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 4 May 2016 07:42:06 +0000 (09:42 +0200)
commitfdfd56453db7c303c8c82531b33401f40700a85e
treea96f9a9f7187d46693ccebd0af207a0bf3d7b768
parent1ca472c7208a7f72ab8a61aa7fe5fe1954fc345b
x86/monitor: disallow setting mem_access_emulate_each_rep when vm_event is NULL

It is meaningless (and potentially dangerous - see hvmemul_virtual_to_linear())
to set mem_access_emulate_each_rep before xc_monitor_enable() (which allocates
vcpu->arch.vm_event) has been called, so return an error from the
XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP hypercall when that is the case.

Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citirx.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
xen/include/asm-x86/monitor.h